package org.example.tlias.exception;

import lombok.extern.slf4j.Slf4j;
import org.example.tlias.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler
    public Result handleException(Exception e) {
        log.error("程序错误，捕获异常", e);
        return Result.error("程序错误");

    }

}











